package com.hzdl.car.mapper;

import com.hzdl.car.bean.Check;
import com.hzdl.car.sqlprovider.CheckSqlProvider;
import com.hzdl.car.vo.CheckVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CheckMapper {
    @Insert("insert into bus_check (checkId,checkDate,checkDesc,problem,payMoney,openName,rentId,createTime) " +
            "values (#{checkId},#{checkDate},#{checkDesc},#{problem},#{payMoney},#{openName},#{rentId},now())")
    int addCheck(CheckVo checkVo);
    @SelectProvider(type = CheckSqlProvider.class,method = "findCheck")
    List<Check> findCheck(CheckVo checkVo);
    @Delete("delete from bus_check where checkId=#{checkId}")
    int delCheck(CheckVo checkVo);
    @Update("update bus_check set checkDate=#{checkDate},checkDesc=#{checkDesc},problem=#{problem},payMoney=#{payMoney}," +
            "openName=#{openName},rentId=#{rentId} where checkId=#{checkId}")
    int updateCheck(CheckVo checkVo);
}
